<?php if(!empty($orderList)){?>
<div class="order_list">
	<h2>我的订单 :</h2>
	<ul class="list_tit">
		<li class="info">我的旅行</li>
		<li class="people">出行人数</li>
		<li class="rate">订单金额</li>
		<li class="status">订单状态</li>
		<li class="operate">操作</li>
	</ul>
	<ul class="list_con">
		<?php foreach($orderList as $value){?>
		<li>
			<p class="no">订单编号:<span><?php echo $value['order_sn'];?></span><a href="<?php echo Yii::app()->request->hostInfo.Yii::app()->createUrl("user/orderdetail", array("ordersn" => $value['order_sn'])); ?>" target="_blank">(查看详情）</a></p>
			<div class="info">
				<div class="i">
					<h3><a href="<?php echo Yii::app()->request->hostInfo.Yii::app()->createUrl("user/orderdetail", array("ordersn" => $value['order_sn'])); ?>" target="_blank"><?php echo $value['goods_name'];?></a></h3>
					<p>出团时间：<?php if($value["travel_date"] != "0000-00-00 00:00:00"){?><?php echo date("Y-m-d", strtotime($value["travel_date"]));?><?php }else{?>待定<?php }?></p>
				</div>
				<a href=""><img src="<?php echo Yii::app()->request->baseUrl.$value['image']; ?>" alt="" /></a>
			</div>
			<p class="people"><?php echo $value['sell_num'];?>人</p>
			<p class="rate">￥ <?php echo $value['total_amount'];?></p>
			<p class="status">
				<?php if($value['is_travel'] == 1){?>
				<strong>已出游</strong>
				<span>下单时间：<?php echo date("Y-m-d", strtotime($value['order_date']));?></span>
				<?php }else if($value['pay_status'] == 0){?>
				<strong>等待支付</strong>
				<span><i></i><?php $diff = strtotime($value['order_expire']) - time();?><?php if($diff > 0){?><?php echo intval($diff/3600);?>小时后订单取消<?php }else{?>订单已过期<?php }?></span>
				<?php }else if($value['pay_status'] == 1){?>
				<strong class="wait">定金￥<i>390.00</i></strong>
				<strong class="wait">等待支付</strong>
				<?php }else if($value['pay_status'] == 2){?>
				<strong>已支付</strong>
				<span>下单时间：<?php echo date("Y-m-d", strtotime($value['order_date']));?></span>
				<?php }else if($value['pay_status'] == 3){?>
				<strong>支付失败</strong>
				<span>下单时间：<?php echo date("Y-m-d", strtotime($value['order_date']));?></span>
				<?php }?>
			</p>
			<div class="operate">
				<?php if($value['is_travel'] == 1){?>
					<?php $date = floor((time() -strtotime($value["travel_date"]))/86400);?>
					<span><i></i>距旅行已过<?php echo $date;?>天</span>
					<a href="javascript:;" class="commet">我要评价</a>
				<?php }else if($value['pay_status'] == 0){?>
					<?php if($diff > 0){?>
					<a href="<?php echo Yii::app()->request->hostInfo.Yii::app()->createUrl("pay/confirm", array("ordersn" => $value['order_sn'])); ?>" target="_blank" class="pay">立即支付</a>
					<?php }else{?>
					<a href="javascript:;" class="pay">立即支付</a>
					<?php }?>
				<?php }else if($value['pay_status'] == 1){?>
				<a href="" class="pay">支付尾款</a>
				<?php }else if($value['pay_status'] == 2){?>
					<?php if($value["travel_date"] != "0000-00-00 00:00:00"){?>
						<?php $date = floor((time() -strtotime($value["travel_date"]))/86400);?>
						<span><i></i>距离出发时间<?php echo $date;?>天</span>
					<?php }else{?>
						<span><i></i>出发时间待定</span>
					<?php }?>
					<a href="<?php echo Yii::app()->request->hostInfo.Yii::app()->createUrl("user/orderdetail", array("ordersn" => $value['order_sn'])); ?>" class="look">查看增值服务</a>
				<?php }else if($value['pay_status'] == 3){?>
				<a href="<?php echo Yii::app()->request->hostInfo.Yii::app()->createUrl("pay/confirm", array("ordersn" => $value['order_sn'])); ?>" class="pay">重新支付</a>
				<?php }?>
				
			</div>
		</li>
		<?php }?>
	</ul>
</div>
<div class="pager">
	<!--上一页-->
	<?php if($currentPage == 1){?>
	<a href="javascript:;" class="prev disabled"></a>
	<?php }else{?>
	<a href="<?php echo Yii::app()->createUrl('user/index');?>" class="prev"></a>
	<?php }?>
	<!--中间页-->
	<?php for($i=1;$i<=$pageNum;$i++){?>
		<?php if($currentPage == $i){?>
		<span><?php echo $i;?></span>
		<?php }else{?>
		<a href="<?php echo Yii::app()->createUrl('user/index', array('current'=>$i));?>"><?php echo $i;?></a>
		<?php }?>
	<?php }?>
	<!--下一页-->
	<?php if($currentPage == $pageNum){?>
	<a href="javascript:;" class="next disabled"></a>
	<?php }else{?>
	<a href="<?php echo Yii::app()->createUrl('user/index', array('current'=>$currentPage+1));?>" class="next"></a>
	<?php }?>
</div>
<?php }else{?>
<div class="order_list">
	<h2>我的订单 :</h2>
	<div class="no_data">
		<span><i></i>咿呀！ 您暂时还没有订单，赶快加入<a href="<?php echo Yii::app()->createUrl("home/index");?>">私家之旅</a> ， 发现世界之美吧~</span>
	</div>
</div>
<?php }?>